<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--导航栏-->
<nav id="h" class="blog-nav layui-header" style="background-color: #3F3F3F" th:fragment="top">
    <div class="blog-container">

        <a class="blog-logo" style="transform:translate(-120px)" th:href="@{/userIndex.html}"></a>

        <ul class="layui-nav" lay-filter="nav">
            <li class="layui-nav-item">
                <a th:href="@{/user/index}"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
            </li>
            <li class="layui-nav-item">
                <a th:href="@{/forum/toPage}"><i class="fa fa-file-text fa-fw"></i>&nbsp;文章专栏</a>
            </li>
            <li class="layui-nav-item">
                <a th:href="@{/qa/toPage}"><i class="fa fa-hourglass-half fa-fw"></i>&nbsp;问答专栏</a>
            </li>
            <li class="layui-nav-item">
                <a th:href="@{/welfare/toPage}"><i class="fa fa-info fa-fw"></i>&nbsp;福利专栏</a>
            </li>
            <li class="layui-nav-item">
                <a th:href="@{/toUserPage}"><i class="fa fa-paper-plane-o fa-fw"></i>&nbsp;用户专栏</a>
            </li>

            <li class="layui-nav-item">
                <form method="get" th:action="@{/article/selectSubmit}">
                    <div class="layui-inline layui-show-xs-block">
                        <input   required="required" type="text" name="selectMessage"  placeholder="请输入搜索关键词" autocomplete="off" class="layui-input">
                    </div>
                    <button type="submit" class="layui-btn" style="background-color: #3F3F3F"><i class="layui-icon">&#xe615;</i></button>
                </form>
            </li>
            <li class="layui-nav-item" style="transform:translate(150px)">
                <a th:href="@{/article/toWrite}"><i class="fa fa-info fa-fw" ></i>&nbsp;发布</a>
            </li>
            <li class="layui-nav-item" style="transform:translate(700px) translateY(-65px)">
                <div class="hotusers-avator" th:if="${session.SPRING_SECURITY_CONTEXT!=null}">
                    <!--头像-->
                    <a th:href="@{/user/detail/article/}" th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.avatar!=null}">
                        <img th:src="@{/common/download/avatar/}+${session.SPRING_SECURITY_CONTEXT.authentication.principal.avatar}" width="45" height="45">
                    </a>
                    <a th:href="@{/user/detail/article/}" th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.avatar==null}">
                        <img th:src="@{/images/avatar/defaultAvatar.jpg}" width="45" height="45">
                    </a>
                </div>
                <div th:if="${session.SPRING_SECURITY_CONTEXT== null}">
                    <a class="layui-nav-item" style="transform:translate(680px) translateY(-65px)">
                        <a th:href="@{/login.html}" ><i class="fa fa-paper-plane-o fa-fw"></i>&nbsp;登录</a>
                    </a>
                </div>
            </li>
            <li class="layui-nav-item" style="transform:translate(680px) translateY(-65px)">
                <a th:href="@{/logout}" th:if="${session.SPRING_SECURITY_CONTEXT != null}"><i class="fa fa-paper-plane-o fa-fw"></i>&nbsp;登出</a>
            </li>
        </ul>
    </div>
</nav>

<!--页脚-->
<footer id="f" class="blog-footer" th:fragment="down">
    <p><span>Copyright</span><span>©</span><span>2022</span>
        <a href="">博客论坛</a><span>Design By stars</span></p>
    <p>
        <a href="" target="_blank">备案号</a>
    </p>
</footer>



</body>
</html>